package com.ruoyi.ylyx.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ylyx.mapper.YlyxAccounthistoryMapper;
import com.ruoyi.ylyx.domain.YlyxAccounthistory;
import com.ruoyi.ylyx.service.IYlyxAccounthistoryService;
import com.ruoyi.common.core.text.Convert;

/**
 * 游戏账户变动Service业务层处理
 * 
 * @author yuexl
 * @date 2021-02-05
 */
@Service
public class YlyxAccounthistoryServiceImpl implements IYlyxAccounthistoryService 
{
    @Autowired
    private YlyxAccounthistoryMapper ylyxAccounthistoryMapper;

    /**
     * 查询游戏账户变动
     * 
     * @param id 游戏账户变动ID
     * @return 游戏账户变动
     */
    @Override
    public YlyxAccounthistory selectYlyxAccounthistoryById(String id)
    {
        return ylyxAccounthistoryMapper.selectYlyxAccounthistoryById(id);
    }

    /**
     * 查询游戏账户变动列表
     * 
     * @param ylyxAccounthistory 游戏账户变动
     * @return 游戏账户变动
     */
    @Override
    public List<YlyxAccounthistory> selectYlyxAccounthistoryList(YlyxAccounthistory ylyxAccounthistory)
    {
        return ylyxAccounthistoryMapper.selectYlyxAccounthistoryList(ylyxAccounthistory);
    }

    /**
     * 新增游戏账户变动
     * 
     * @param ylyxAccounthistory 游戏账户变动
     * @return 结果
     */
    @Override
    public int insertYlyxAccounthistory(YlyxAccounthistory ylyxAccounthistory)
    {
        ylyxAccounthistory.setCreateTime(DateUtils.getNowDate());
        return ylyxAccounthistoryMapper.insertYlyxAccounthistory(ylyxAccounthistory);
    }

    /**
     * 修改游戏账户变动
     * 
     * @param ylyxAccounthistory 游戏账户变动
     * @return 结果
     */
    @Override
    public int updateYlyxAccounthistory(YlyxAccounthistory ylyxAccounthistory)
    {
        ylyxAccounthistory.setUpdateTime(DateUtils.getNowDate());
        return ylyxAccounthistoryMapper.updateYlyxAccounthistory(ylyxAccounthistory);
    }

    /**
     * 删除游戏账户变动对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteYlyxAccounthistoryByIds(String ids)
    {
        return ylyxAccounthistoryMapper.deleteYlyxAccounthistoryByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除游戏账户变动信息
     * 
     * @param id 游戏账户变动ID
     * @return 结果
     */
    @Override
    public int deleteYlyxAccounthistoryById(String id)
    {
        return ylyxAccounthistoryMapper.deleteYlyxAccounthistoryById(id);
    }
}
